<?php
require_once(dirname(__FILE__) . '/../../../system/git/context.php');
require_once(dirname(__FILE__) . '/../../../git/handler/gitCallbackHandler.php');

class ControllerAccountGitCallback extends Controller {
	public function index() {
		$inputEmail = isset($_GET['rp_input_email']) ? $_GET['rp_input_email'] : '';
		$purpose = isset($_GET['rp_purpose']) ? $_GET['rp_purpose'] : '';
		$url = gitUtil::getCurrentUrl();
		$url = str_replace('&amp;', '&', $url);
		$idpResponse = @file_get_contents('php://input');

		ContextLoader::load($this->registry);
		$handler = new gitCallbackHandler($inputEmail, $purpose, $url, $idpResponse);
		$handler->execute();
	}
}
?>
